home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / libs / x / xview / xview3.004 / xview3 / usr / openwin / include / xview_private / noticeimpl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-29  |  6.1 KB  |  208 lines

  1. /*    @(#)noticeimpl.h 20.38 93/06/28    */
  2.  
  3. /* ------------------------------------------------------------------ */
  4. /*    
  5.  *    (c) Copyright 1989 Sun Microsystems, Inc. Sun design patents 
  6.  *    pending in the U.S. and foreign countries. See LEGAL_NOTICE 
  7.  *    file for terms of the license. 
  8.  */
  9. /* ------------------------------------------------------------------ */
  10.  
  11. #ifndef notice_impl_h_already_defined
  12. #define notice_impl_h_already_defined
  13.  
  14. #ifdef OW_I18N
  15. #include <xview/xv_i18n.h>
  16. #endif /* OW_I18N */
  17. #include <xview_private/i18n_impl.h>
  18. #include <olgx/olgx.h>
  19. #include <xview/pkg.h>
  20. #include <xview/generic.h>
  21. #include <xview/svrimage.h>
  22. #include <xview/panel.h>
  23. #include <xview/frame.h>
  24. #include <xview/fullscreen.h>
  25. #include <xview/font.h>
  26. #include <xview/defaults.h>
  27.  
  28. #include <xview/notice.h>
  29.  
  30. #define NOTICE_PRIVATE(notice_public)    XV_PRIVATE(Notice_info, Xv_notice_struct, notice_public)
  31. #define    NOTICE_PUBLIC(notice)    XV_PUBLIC(notice)
  32. #define NOTICE_HELP        (NOTICE_TRIGGERED-1)
  33. #define NOTICE_ACTION_DO_IT    '\015'
  34.  
  35. #define VERT_MSG_MARGIN(scale)        Notice_dimensions[scale].vert_msg_margin
  36. #define HORIZ_MSG_MARGIN(scale)        Notice_dimensions[scale].horiz_msg_margin
  37. #define APEX_DIST(scale)        Notice_dimensions[scale].apex_dist
  38. #define BUT_PORTION_HEIGHT(scale)    Notice_dimensions[scale].but_portion_height
  39. #define FONT_POINTSIZE(scale)        Notice_dimensions[scale].font_pointsize
  40. #define FONT_POINTSIZE(scale)        Notice_dimensions[scale].font_pointsize
  41. #define NOTICE_BORDER_WIDTH(scale)    Notice_dimensions[scale].border_width
  42. #define PANE_BORDER_WIDTH(scale)    Notice_dimensions[scale].pane_border_width
  43. #define PANE_NOTICE_BORDER_DIST(scale)    Notice_dimensions[scale].pane_notice_border_dist
  44. #define MSG_VERT_GAP(scale)        Notice_dimensions[scale].msg_vert_gap
  45. #define BUT_HORIZ_GAP(scale)        Notice_dimensions[scale].but_horiz_gap
  46.  
  47. #define NOTICE_NOT_TOPLEVEL        0
  48. #define NOTICE_IS_TOPLEVEL        1
  49.  
  50. #define PANE_XY(is_toplevel_window, scale)        \
  51.         ( is_toplevel_window ?            \
  52.             (NOTICE_BORDER_WIDTH(scale)+    \
  53.             PANE_NOTICE_BORDER_DIST(scale)+    \
  54.             PANE_BORDER_WIDTH(scale)) :        \
  55.             PANE_BORDER_WIDTH(scale)        \
  56.         )
  57. #define    PANE_NOTICE_DIFF(is_toplevel_window, scale) \
  58.         (2 * (PANE_XY(is_toplevel_window, scale)+1))
  59.  
  60. #define        NOTICE_SMALL        0
  61. #define        NOTICE_MEDIUM        1
  62. #define        NOTICE_LARGE        2
  63. #define        NOTICE_EXTRALARGE    3
  64.  
  65. /* ------------------------------------------------------------------ */
  66. /* -------------- opaque types and useful typedefs  ----------------- */
  67. /* ------------------------------------------------------------------ */
  68.  
  69. typedef struct notice {
  70.     Xv_Notice        public_self;
  71.  
  72.     Frame        client_window;
  73.     Frame        owner_window;
  74.  
  75.     /*
  76.      * XView objects that make up the non-screen locking
  77.      * notice
  78.      */
  79.     Frame        sub_frame;
  80.     Panel        panel;
  81.     Frame        *busy_frames;
  82.     void        (*event_proc)();
  83.  
  84.     Fullscreen        fullscreen;
  85.     Xv_object        fullscreen_window;
  86.  
  87.     int            result;
  88.     int            *result_ptr;
  89.  
  90.     int            default_input_code;
  91.     Event        *event;
  92.     Event        help_event;
  93.  
  94.     Xv_Font        notice_font;
  95.  
  96.     int            beeps;
  97.     
  98.     int            focus_x;
  99.     int            focus_y;
  100.  
  101.     int            old_mousex;
  102.     int            old_mousey;
  103.  
  104.     CHAR        **message_items;
  105.  
  106.     int            number_of_buttons;
  107.     int            number_of_strs;
  108.     struct notice_buttons *button_info;
  109.     struct notice_msgs     *msg_info;
  110.     char         *help_data;
  111.  
  112.     Graphics_info    *ginfo;
  113.     int            three_d;
  114.  
  115.     /*
  116.      * Notice scale
  117.      */
  118.     int            scale;
  119.  
  120.     /* flags */
  121.     unsigned        lock_screen:1;
  122.     unsigned        yes_button_exists:1;
  123.     unsigned        no_button_exists:1;
  124.     unsigned        focus_specified:1;
  125.     unsigned        dont_beep:1;
  126.     unsigned        need_layout:1;
  127.     unsigned        show:1;
  128.     unsigned        new:1;
  129.     unsigned        block_thread:1;
  130.  
  131. } Notice_info;
  132.  
  133. typedef struct notice    *notice_handle;
  134.  
  135. struct notice_msgs {
  136.     Panel            panel_item;
  137.     CHAR            *string;
  138.     struct rect             msg_rect;
  139.     struct notice_msgs        *next;
  140. };
  141.  
  142. struct notice_buttons {
  143.     Panel            panel_item;
  144.     CHAR            *string;
  145.     int                 value;
  146.     int                 is_yes;
  147.     int                 is_no;
  148.     struct rect             button_rect;
  149.     struct notice_buttons    *next;
  150. };
  151.  
  152. typedef struct notice_buttons    *notice_buttons_handle;
  153. typedef struct notice_msgs    *notice_msgs_handle;
  154.  
  155. typedef struct {
  156.     unsigned int    width;            /* (a) */
  157.     unsigned int    vert_msg_margin;    /* (b) */
  158.     unsigned int    horiz_msg_margin;    /* (c) */
  159.     unsigned int    apex_dist;        /* (d) */
  160.     unsigned int    but_portion_height;    /* (e) */
  161.     unsigned int    font_pointsize;        /* (f) */
  162.     unsigned int    border_width;        /* extra */
  163.     unsigned int    pane_border_width;    /* extra */
  164.     unsigned int    pane_notice_border_dist;/* extra */
  165.     unsigned int    msg_vert_gap;        /* extra */
  166.     unsigned int    but_horiz_gap;        /* extra */
  167. }Notice_config;
  168.  
  169. Pkg_private Notice_config    Notice_dimensions[];
  170.  
  171. Pkg_private void            notice_add_default_button();
  172. Pkg_private void            notice_defaults();
  173. Pkg_private void            notice_add_button_to_list();
  174. Pkg_private void            notice_add_msg_to_list();
  175. Pkg_private void            notice_free_button_structs();
  176. Pkg_private void            notice_free_msg_structs();
  177. Pkg_private void            notice_do_bell();
  178. Pkg_private void            notice_init_cursor();
  179. Pkg_private void            notice_draw_borders();
  180. Pkg_private void            notice_get_notice_size();
  181. Pkg_private void            notice_layout();
  182. Pkg_private void            notice_do_buttons();
  183. Pkg_private void            notice_drawbox();
  184. Pkg_private void            notice_build_button();
  185. Pkg_private void            notice_button_panel_proc();
  186. Pkg_private int                notice_determine_font();
  187. Pkg_private int                notice_center();
  188. Pkg_private int                notice_subframe_layout();
  189. Pkg_private int                notice_text_width();
  190. Pkg_private int                notice_button_width();
  191. Pkg_private int                notice_get_owner_frame();
  192. Pkg_private notice_buttons_handle    notice_create_button_struct();
  193. Pkg_private notice_msgs_handle        notice_create_msg_struct();
  194.  
  195. Pkg_private Xv_opaque    notice_set_avlist();
  196. Pkg_private Xv_opaque    notice_generic_set();
  197. Pkg_private Xv_opaque    notice_get_attr();
  198. Pkg_private int        notice_destroy_internal();
  199. Pkg_private int        notice_init_internal();
  200.  
  201. Pkg_private int        default_beeps;
  202. Pkg_private int        notice_use_audible_bell;
  203. Pkg_private int        notice_jump_cursor;
  204. Pkg_private int        notice_context_key;
  205. Pkg_private Defaults_pairs bell_types[];
  206.  
  207. #endif notice_impl_h_already_defined
  208.